package com.dream.dynamic_datasource.config;

import com.dream.dynamic_datasource.filter.LoginFilter;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * @description:
 * @author: Luo
 * @create: 2020-07-14 16:45
 */
@SpringBootConfiguration
public class LoginConfig {
    @Bean
    public FilterRegistrationBean setFilter(LoginFilter loginFilter ){
        FilterRegistrationBean filterBean = new FilterRegistrationBean( );
        filterBean.setFilter(loginFilter);
        filterBean.setName("FilterController");
        filterBean.addUrlPatterns("/*");
        return filterBean;
    }
}
